package com.TTBook.core.book.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class BookStorageCriteria {
    protected String orderByClause;

    protected List oredCriteria;

    public BookStorageCriteria() {
        oredCriteria = new ArrayList();
    }

    protected BookStorageCriteria(BookStorageCriteria example) {
        this.orderByClause = example.orderByClause;
        this.oredCriteria = example.oredCriteria;
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public List getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ts_book_storage
     *
     *  Wed Oct 16 00:16:16 CST 2013
     */
    public void clear() {
        oredCriteria.clear();
    }

    public static class Criteria {
        protected List criteriaWithoutValue;

        protected List criteriaWithSingleValue;

        protected List criteriaWithListValue;

        protected List criteriaWithBetweenValue;

        protected Criteria() {
            super();
            criteriaWithoutValue = new ArrayList();
            criteriaWithSingleValue = new ArrayList();
            criteriaWithListValue = new ArrayList();
            criteriaWithBetweenValue = new ArrayList();
        }

        public boolean isValid() {
            return criteriaWithoutValue.size() > 0
                || criteriaWithSingleValue.size() > 0
                || criteriaWithListValue.size() > 0
                || criteriaWithBetweenValue.size() > 0;
        }

        public List getCriteriaWithoutValue() {
            return criteriaWithoutValue;
        }

        public List getCriteriaWithSingleValue() {
            return criteriaWithSingleValue;
        }

        public List getCriteriaWithListValue() {
            return criteriaWithListValue;
        }

        public List getCriteriaWithBetweenValue() {
            return criteriaWithBetweenValue;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteriaWithoutValue.add(condition);
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            Map map = new HashMap();
            map.put("condition", condition);
            map.put("value", value);
            criteriaWithSingleValue.add(map);
        }

        protected void addCriterion(String condition, List values, String property) {
            if (values == null || values.size() == 0) {
                throw new RuntimeException("Value list for " + property + " cannot be null or empty");
            }
            Map map = new HashMap();
            map.put("condition", condition);
            map.put("values", values);
            criteriaWithListValue.add(map);
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            List list = new ArrayList();
            list.add(value1);
            list.add(value2);
            Map map = new HashMap();
            map.put("condition", condition);
            map.put("values", list);
            criteriaWithBetweenValue.add(map);
        }

        public Criteria andBookidIsNull() {
            addCriterion("BOOKID is null");
            return this;
        }

        public Criteria andBookidIsNotNull() {
            addCriterion("BOOKID is not null");
            return this;
        }

        public Criteria andBookidEqualTo(String value) {
            addCriterion("BOOKID =", value, "bookid");
            return this;
        }

        public Criteria andBookidNotEqualTo(String value) {
            addCriterion("BOOKID <>", value, "bookid");
            return this;
        }

        public Criteria andBookidGreaterThan(String value) {
            addCriterion("BOOKID >", value, "bookid");
            return this;
        }

        public Criteria andBookidGreaterThanOrEqualTo(String value) {
            addCriterion("BOOKID >=", value, "bookid");
            return this;
        }

        public Criteria andBookidLessThan(String value) {
            addCriterion("BOOKID <", value, "bookid");
            return this;
        }

        public Criteria andBookidLessThanOrEqualTo(String value) {
            addCriterion("BOOKID <=", value, "bookid");
            return this;
        }

        public Criteria andBookidLike(String value) {
            addCriterion("BOOKID like", value, "bookid");
            return this;
        }

        public Criteria andBookidNotLike(String value) {
            addCriterion("BOOKID not like", value, "bookid");
            return this;
        }

        public Criteria andBookidIn(List values) {
            addCriterion("BOOKID in", values, "bookid");
            return this;
        }

        public Criteria andBookidNotIn(List values) {
            addCriterion("BOOKID not in", values, "bookid");
            return this;
        }

        public Criteria andBookidBetween(String value1, String value2) {
            addCriterion("BOOKID between", value1, value2, "bookid");
            return this;
        }

        public Criteria andBookidNotBetween(String value1, String value2) {
            addCriterion("BOOKID not between", value1, value2, "bookid");
            return this;
        }

        public Criteria andAddressidIsNull() {
            addCriterion("ADDRESSID is null");
            return this;
        }

        public Criteria andAddressidIsNotNull() {
            addCriterion("ADDRESSID is not null");
            return this;
        }

        public Criteria andAddressidEqualTo(String value) {
            addCriterion("ADDRESSID =", value, "addressid");
            return this;
        }

        public Criteria andAddressidNotEqualTo(String value) {
            addCriterion("ADDRESSID <>", value, "addressid");
            return this;
        }

        public Criteria andAddressidGreaterThan(String value) {
            addCriterion("ADDRESSID >", value, "addressid");
            return this;
        }

        public Criteria andAddressidGreaterThanOrEqualTo(String value) {
            addCriterion("ADDRESSID >=", value, "addressid");
            return this;
        }

        public Criteria andAddressidLessThan(String value) {
            addCriterion("ADDRESSID <", value, "addressid");
            return this;
        }

        public Criteria andAddressidLessThanOrEqualTo(String value) {
            addCriterion("ADDRESSID <=", value, "addressid");
            return this;
        }

        public Criteria andAddressidLike(String value) {
            addCriterion("ADDRESSID like", value, "addressid");
            return this;
        }

        public Criteria andAddressidNotLike(String value) {
            addCriterion("ADDRESSID not like", value, "addressid");
            return this;
        }

        public Criteria andAddressidIn(List values) {
            addCriterion("ADDRESSID in", values, "addressid");
            return this;
        }

        public Criteria andAddressidNotIn(List values) {
            addCriterion("ADDRESSID not in", values, "addressid");
            return this;
        }

        public Criteria andAddressidBetween(String value1, String value2) {
            addCriterion("ADDRESSID between", value1, value2, "addressid");
            return this;
        }

        public Criteria andAddressidNotBetween(String value1, String value2) {
            addCriterion("ADDRESSID not between", value1, value2, "addressid");
            return this;
        }

        public Criteria andStorageIsNull() {
            addCriterion("STORAGE is null");
            return this;
        }

        public Criteria andStorageIsNotNull() {
            addCriterion("STORAGE is not null");
            return this;
        }

        public Criteria andStorageEqualTo(Integer value) {
            addCriterion("STORAGE =", value, "storage");
            return this;
        }

        public Criteria andStorageNotEqualTo(Integer value) {
            addCriterion("STORAGE <>", value, "storage");
            return this;
        }

        public Criteria andStorageGreaterThan(Integer value) {
            addCriterion("STORAGE >", value, "storage");
            return this;
        }

        public Criteria andStorageGreaterThanOrEqualTo(Integer value) {
            addCriterion("STORAGE >=", value, "storage");
            return this;
        }

        public Criteria andStorageLessThan(Integer value) {
            addCriterion("STORAGE <", value, "storage");
            return this;
        }

        public Criteria andStorageLessThanOrEqualTo(Integer value) {
            addCriterion("STORAGE <=", value, "storage");
            return this;
        }

        public Criteria andStorageIn(List values) {
            addCriterion("STORAGE in", values, "storage");
            return this;
        }

        public Criteria andStorageNotIn(List values) {
            addCriterion("STORAGE not in", values, "storage");
            return this;
        }

        public Criteria andStorageBetween(Integer value1, Integer value2) {
            addCriterion("STORAGE between", value1, value2, "storage");
            return this;
        }

        public Criteria andStorageNotBetween(Integer value1, Integer value2) {
            addCriterion("STORAGE not between", value1, value2, "storage");
            return this;
        }

        public Criteria andFrozenStorageIsNull() {
            addCriterion("FROZEN_STORAGE is null");
            return this;
        }

        public Criteria andFrozenStorageIsNotNull() {
            addCriterion("FROZEN_STORAGE is not null");
            return this;
        }

        public Criteria andFrozenStorageEqualTo(Integer value) {
            addCriterion("FROZEN_STORAGE =", value, "frozenStorage");
            return this;
        }

        public Criteria andFrozenStorageNotEqualTo(Integer value) {
            addCriterion("FROZEN_STORAGE <>", value, "frozenStorage");
            return this;
        }

        public Criteria andFrozenStorageGreaterThan(Integer value) {
            addCriterion("FROZEN_STORAGE >", value, "frozenStorage");
            return this;
        }

        public Criteria andFrozenStorageGreaterThanOrEqualTo(Integer value) {
            addCriterion("FROZEN_STORAGE >=", value, "frozenStorage");
            return this;
        }

        public Criteria andFrozenStorageLessThan(Integer value) {
            addCriterion("FROZEN_STORAGE <", value, "frozenStorage");
            return this;
        }

        public Criteria andFrozenStorageLessThanOrEqualTo(Integer value) {
            addCriterion("FROZEN_STORAGE <=", value, "frozenStorage");
            return this;
        }

        public Criteria andFrozenStorageIn(List values) {
            addCriterion("FROZEN_STORAGE in", values, "frozenStorage");
            return this;
        }

        public Criteria andFrozenStorageNotIn(List values) {
            addCriterion("FROZEN_STORAGE not in", values, "frozenStorage");
            return this;
        }

        public Criteria andFrozenStorageBetween(Integer value1, Integer value2) {
            addCriterion("FROZEN_STORAGE between", value1, value2, "frozenStorage");
            return this;
        }

        public Criteria andFrozenStorageNotBetween(Integer value1, Integer value2) {
            addCriterion("FROZEN_STORAGE not between", value1, value2, "frozenStorage");
            return this;
        }
    }
}